﻿module Sustainalytics.GovernanceReports {

    // Portfolio List controller
    export class DeleteCheckController {

        public resultCheck: boolean;
        // Ctor.
        constructor(
            private $rootScope: ng.IScope,
            private $scope: ng.IScope,
            private $q: ng.IQService,
            private $location: ng.ILocationService,
            private $modal: IModal,
            private $modalInstance: IModalInstance) {

            var ctx = this;
            $scope['deleteCheck'] = ctx;
        }

        public closeDialog = function () {
            var ctx = this;
            ctx.resultCheck = false;
            ctx.$modalInstance.close({ deleteCheck: ctx.resultCheck });
        };

        public deleteProfileAlert() {
            var ctx = this;
            var def = this.$q.defer();
            ctx.resultCheck = true;
            this.$modalInstance.close({ deleteCheck: ctx.resultCheck });
        }
    }

    // register controller with GovernanceReports Angular module
    angular.module('Sustainalytics.GovernanceReports').controller('DeleteCheckController', function ($rootScope: ng.IScope, $scope: ng.IScope, $q: ng.IQService, $location: ng.ILocationService, $modal: IModal, $modalInstance: IModalInstance) {
        var ctrl = new Sustainalytics.GovernanceReports.DeleteCheckController($rootScope, $scope, $q, $location, $modal, $modalInstance);
        return ctrl;
    });
} 
  